package com.dom.domweb.common;

import com.dom.common.constants.ConstantError;
import lombok.Data;

/**
 * @Description web请求模型
 * @Author xllei
 * @Date 2018/11/15 下午2:50
 * @Version 1.0
 **/
@Data
public class RspModel {
    public static final String SUCC_CODE = "RSP000000";

    private String rspCode;
    private String rspMsg;
    private Object data;

    public RspModel(String rspCode, String rspMsg){
        this.rspCode = rspCode;
        this.rspMsg = rspMsg;
    }

    public RspModel(Object obj){
        this.rspCode = SUCC_CODE;
        this.data = obj;
    }

    public RspModel(ConstantError error){
        this.rspCode = error.getErrCode();
        this.rspMsg = error.getErrMsg();
    }
}
